package com.shuyuntu.proposal.service;

import com.shuyuntu.proposal.dao.IDepartmentDao;
import com.shuyuntu.proposal.entity.Department;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by limeng on 16-4-17.
 */
@Service("departmentService")
public class DepartmentService {
    public List<Department> getDepartmentList() {
        List<Department> list = departmentDao.queryList();
        return list;
    }

    @Transactional
    public Department getDepartmentById(String hostDepartmentId) {
        return departmentDao.queryById(hostDepartmentId);
    }

    /******* 依赖注入 *******/
    @Resource
    IDepartmentDao departmentDao;

    public IDepartmentDao getDepartmentDao() {
        return departmentDao;
    }

    public void setDepartmentDao(IDepartmentDao departmentDao) {
        this.departmentDao = departmentDao;
    }

}
